<script>
	export default {
		onLaunch: function() {
			let token = uni.getStorageSync("token")
			
			if (token) {
				uni.switchTab({
					url:'/pages/home/index'
				})
			} else {
				uni.reLaunch({
					url:'/pages/index/index'
				})
			} 
		},
		methods: {
			// 示例函数，用于发送请求到后端以获取 token
			fetchToken(code) {
				// 调用后端 API，将 code 发送到后端
				// 例如 axios.post('/api/get-token', { code: code }).then(...)
				console.log('Fetching token with code:', code);
			}
		},
		onShow: function() {
			console.log('App Show');
		},
		onHide: function() {
			console.log('App Hide');
		}
	}
</script>

<style lang="scss">
	@import "uview-ui/index.scss";
	/*每个页面公共css */
	@import "colorui/main.css";
	@import "colorui/icon.css";
	@import "@/styles/index.scss"; // global css
	@import "@/styles/theme-scrollor.scss";
	@import "@/styles/element-ui.scss";
	@import "@/styles/simple-ui.scss";
	
	.el-upload-dragger{
		width: 100% !important;
		height: 80rpx !important;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	.el-upload{
		width: 100% !important;
	}
	.el-upload-dragger .el-icon-upload{
		margin: 0px !important;
	}
	.u-form-item{
		border-bottom: none !important;
		padding: 0 !important;
	}
</style>
